import { createSlice, PayloadAction } from '@reduxjs/toolkit';


interface dataType{
  user_name:string
}

export const getter = (state: any): dataType => {
  return state.News;
};

export const counterSlice = createSlice({
  name: 'News',
  initialState: {
    user_name:"kay"
  } as dataType,
  reducers: {
    updateName(state, actions) {
      state.user_name = "123";
    }
  },
});

// Action creators are generated for each case reducer function
export const {
  updateName
} = counterSlice.actions;


export default counterSlice.reducer;
